import 'dart:convert' show json;

class ProductModel {

  String code;
  String message;
  ProductModelData data;

  ProductModel.fromParams({this.code, this.message, this.data});

  factory ProductModel(jsonStr) => jsonStr == null ? null : jsonStr is String ? new ProductModel.fromJson(json.decode(jsonStr)) : new ProductModel.fromJson(jsonStr);

  ProductModel.fromJson(jsonRes) {
    code = jsonRes['code'];
    message = jsonRes['message'];
    data = jsonRes['data'] == null ? null : new ProductModelData.fromJson(jsonRes['data']);
  }

  @override
  String toString() {
    return '{"code": ${code != null?'${json.encode(code)}':'null'},"message": ${message != null?'${json.encode(message)}':'null'},"data": $data}';
  }
}

class ProductModelData {

  var coupon_end;
  var coupon_id;
  var coupon_info;
  var coupon_left;
  var coupon_link;
  var coupon_start;
  var coupon_total;
  var item_description;
  var coupon_money;
  var fanli_money;
  var num_iid;
  var qh_price;
  var real_price;
  var sale_money;
  var seller_id;
  var volume;
  var zk_price;
  String clean_title;
  String coupon_tkl;
  String id;
  String item_url;
  String nick;
  var pict_url;
  String shop_title;
  String title;
  String tkl;
  String userLevel;
  List<String> shareInfo;
  List<String> small_images;

  ProductModelData.fromParams({this.coupon_end, this.coupon_id, this.coupon_info, this.coupon_left, this.coupon_link, this.coupon_start, this.coupon_total, this.item_description, this.coupon_money, this.fanli_money, this.num_iid, this.qh_price, this.real_price, this.sale_money, this.seller_id, this.volume, this.zk_price, this.clean_title, this.coupon_tkl, this.id, this.item_url, this.nick, this.pict_url, this.shop_title, this.title, this.tkl, this.userLevel, this.shareInfo, this.small_images});

  ProductModelData.fromJson(jsonRes) {
    coupon_end = jsonRes['coupon_end'];
    coupon_id = jsonRes['coupon_id'];
    coupon_info = jsonRes['coupon_info'];
    coupon_left = jsonRes['coupon_left'];
    coupon_link = jsonRes['coupon_link'];
    coupon_start = jsonRes['coupon_start'];
    coupon_total = jsonRes['coupon_total'];
    item_description = jsonRes['item_description'];
    coupon_money = jsonRes['coupon_money'];
    fanli_money = jsonRes['fanli_money'];
    num_iid = jsonRes['num_iid'];
    qh_price = jsonRes['qh_price'];
    real_price = jsonRes['real_price'];
    sale_money = jsonRes['sale_money'];
    seller_id = jsonRes['seller_id'];
    volume = jsonRes['volume'];
    zk_price = jsonRes['zk_price'];
    clean_title = jsonRes['clean_title'];
    coupon_tkl = jsonRes['coupon_tkl'];
    id = jsonRes['id'];
    item_url = jsonRes['item_url'];
    nick = jsonRes['nick'];
    pict_url = jsonRes['pict_url'];
    shop_title = jsonRes['shop_title'];
    title = jsonRes['title'];
    tkl = jsonRes['tkl'];
    userLevel = jsonRes['userLevel'];
    shareInfo = jsonRes['shareInfo'] == null ? null : [];

    for (var shareInfoItem in shareInfo == null ? [] : jsonRes['shareInfo']){
      shareInfo.add(shareInfoItem);
    }

    small_images = jsonRes['small_images'] == null ? null : [];

    for (var small_imagesItem in small_images == null ? [] : jsonRes['small_images']){
      small_images.add(small_imagesItem);
    }
  }

  @override
  String toString() {
    return '{"coupon_end": $coupon_end,"coupon_id": $coupon_id,"coupon_info": $coupon_info,"coupon_left": $coupon_left,"coupon_link": $coupon_link,"coupon_start": $coupon_start,"coupon_total": $coupon_total,"item_description": $item_description,"coupon_money": $coupon_money,"fanli_money": $fanli_money,"num_iid": $num_iid,"qh_price": ${qh_price != null?'${json.encode(qh_price)}':'null'},"real_price": $real_price,"sale_money": $sale_money,"seller_id": $seller_id,"volume": $volume,"zk_price": $zk_price,"clean_title": ${clean_title != null?'${json.encode(clean_title)}':'null'},"coupon_tkl": ${coupon_tkl != null?'${json.encode(coupon_tkl)}':'null'},"id": ${id != null?'${json.encode(id)}':'null'},"item_url": ${item_url != null?'${json.encode(item_url)}':'null'},"nick": ${nick != null?'${json.encode(nick)}':'null'},"pict_url": $pict_url,"shop_title": ${shop_title != null?'${json.encode(shop_title)}':'null'},"title": ${title != null?'${json.encode(title)}':'null'},"tkl": ${tkl != null?'${json.encode(tkl)}':'null'},"userLevel": ${userLevel != null?'${json.encode(userLevel)}':'null'},"shareInfo": $shareInfo,"small_images": $small_images}';
  }
}

